// custom-$message.js
import ElementUI from 'element-ui';
export default {
  install(Vue, options) {
    Vue.prototype.$message = function(msg, type) {
      ElementUI.Message({
        message: msg,
        type: type,
        customClass: 'showFront'
      });
    };
    Vue.prototype.$message.error = function(msg) {
      ElementUI.Message({
        message: msg,
        duration: 10000,
        showClose: true,
        customClass: 'showFront',
        type: 'error'
      });
    };
    Vue.prototype.$message.warning = function(msg) {
      ElementUI.Message({
        message: msg,
        duration: 10000,
        showClose: true,
        customClass: 'showFront',
        type: 'warning'
      });
    };
    Vue.prototype.$message.success = function(msg) {
      ElementUI.Message({
        message: msg,
        type: 'success',
        customClass: 'showFront'
      });
    };
    Vue.prototype.$message.close = function() {
      return ElementUI.Message.close();
    };
    Vue.prototype.$message.closeAll = function() {
      return ElementUI.Message.closeAll();
    };
  }
};
